import { myOrder } from '@/api/order'

export default {
  namespaced: true,
  state () {
    return {
      orderList: []
    }
  },
  mutations: {
    getAllOrderMutation (state, data) {
      state.orderList = data
    }
  },
  actions: {
    async getAllOrderAction (context, obj) {
      const { dataType, page } = obj
      const result = await myOrder(dataType, page)
      console.log(result)
      context.commit('getAllOrderMutation', result.data.list.data)
    }
  },
  getters: {}
}
